package com.yhk.wuchat.common.common.util;

/**
 * @version 1.0
 * @Author moresuo
 * @Date 2024/4/8 15:38
 * @注释
 */

import com.yhk.wuchat.common.common.domain.dto.RequestInfo;

/**
 * 保存每个用户请求的上下文信息
 */
public class RequestHolder {
    private static final ThreadLocal<RequestInfo> threadLocal = new ThreadLocal<>();

    public static void set(RequestInfo requestInfo){
        threadLocal.set(requestInfo);
    }
    public static RequestInfo get(){
        return threadLocal.get();
    }
    public static void remove(){
        threadLocal.remove();
    }
}
